/*
 * @Author: weikang
 * @Description:
 * @Date: 2024-02-20 21:56:10
 * @LastEditTime: 2024-03-30 14:59:33
 * @FilePath: \env-manager-pc\src\views\system\role\page.ts
 */

export function useRules() {
  return computed(() => ({
    Name: {
      required: true,
      message: '请输入角色名称',
      trigger: 'blur',
    },
  }))
}

export interface roleForm {
  ObjID: string
  Name: string
  Remark: string
  Popedoms: any
}

export function useInitForm(): { formData: Ref<roleForm>, initForm: () => void } {
  const getData = (): roleForm => ({
    ObjID: '',
    Name: '',
    Remark: '',
    Popedoms: {},
  })
  const formData = ref<roleForm>(getData())

  const initForm = () => {
    formData.value = getData()
  }

  return { formData, initForm }
}
